From 65eb2382d6a31968df149833578d1b2908ee829c Mon Sep 17 00:00:00 2001 From: SevenEarth <391613297@qq.com> Date: Tue, 10 Dec 2024 15:49:49 +0800 Subject: [PATCH] add --- tencentcloud/provider.go | 1 + tencentcloud/provider.md | 1 + ...e_tc_postgresql_instance_network_access.go | 6 ++- ...esql_instance_network_access.html.markdown | 46 +++++++++++++++++++ website/tencentcloud.erb | 3 ++ 5 files changed, 55 insertions(+), 2 deletions(-) create mode 100644 website/docs/r/postgresql_instance_network_access.html.markdown diff --git a/tencentcloud/provider.go b/tencentcloud/provider.go index 8c81997ea3..259f3a98d0 100644 --- a/tencentcloud/provider.go +++ b/tencentcloud/provider.go @@ -1525,6 +1525,7 @@ func Provider() *schema.Provider { "tencentcloud_postgresql_account_privileges_operation": postgresql.ResourceTencentCloudPostgresqlAccountPrivilegesOperation(), "tencentcloud_postgresql_apply_parameter_template_operation": postgresql.ResourceTencentCloudPostgresqlApplyParameterTemplateOperation(), "tencentcloud_postgresql_clone_db_instance": postgresql.ResourceTencentCloudPostgresqlCloneDbInstance(), + "tencentcloud_postgresql_instance_network_access": postgresql.ResourceTencentCloudPostgresqlInstanceNetworkAccess(), "tencentcloud_sqlserver_instance": sqlserver.ResourceTencentCloudSqlserverInstance(), "tencentcloud_sqlserver_db": sqlserver.ResourceTencentCloudSqlserverDB(), "tencentcloud_sqlserver_account": sqlserver.ResourceTencentCloudSqlserverAccount(), diff --git a/tencentcloud/provider.md b/tencentcloud/provider.md index f3ff56b525..524a8a6410 100644 --- a/tencentcloud/provider.md +++ b/tencentcloud/provider.md @@ -908,6 +908,7 @@ TencentDB for PostgreSQL(PostgreSQL) tencentcloud_postgresql_account tencentcloud_postgresql_apply_parameter_template_operation tencentcloud_postgresql_clone_db_instance + tencentcloud_postgresql_instance_network_access TencentDB for Redis(crs) Data Source diff --git a/tencentcloud/services/postgresql/resource_tc_postgresql_instance_network_access.go b/tencentcloud/services/postgresql/resource_tc_postgresql_instance_network_access.go index 15ac1787ea..b2906689ef 100644 --- a/tencentcloud/services/postgresql/resource_tc_postgresql_instance_network_access.go +++ b/tencentcloud/services/postgresql/resource_tc_postgresql_instance_network_access.go @@ -140,7 +140,7 @@ func resourceTencentCloudPostgresqlInstanceNetworkAccessCreate(d *schema.Resourc }).WaitForStateContext(ctx); err != nil { return err } - + // get vip service := PostgresqlService{client: meta.(tccommon.ProviderMeta).GetAPIV3Conn()} respData, err := service.DescribePostgresqlInstanceNetworkAccessById(ctx, dbInsntaceId) @@ -155,7 +155,9 @@ func resourceTencentCloudPostgresqlInstanceNetworkAccessCreate(d *schema.Resourc if respData.DBInstanceNetInfo != nil && len(respData.DBInstanceNetInfo) > 0 { for _, item := range respData.DBInstanceNetInfo { - if *item.VpcId == vpcId && + if *item.VpcId == vpcId && *item.SubnetId == subnetId { + + } } } diff --git a/website/docs/r/postgresql_instance_network_access.html.markdown b/website/docs/r/postgresql_instance_network_access.html.markdown new file mode 100644 index 0000000000..b4c9c5e4d0 --- /dev/null +++ b/website/docs/r/postgresql_instance_network_access.html.markdown @@ -0,0 +1,46 @@ +--- +subcategory: "TencentDB for PostgreSQL(PostgreSQL)" +layout: "tencentcloud" +page_title: "TencentCloud: tencentcloud_postgresql_instance_network_access" +sidebar_current: "docs-tencentcloud-resource-postgresql_instance_network_access" +description: |- + Provides a resource to create a postgres postgresql_instance_network_access +--- + +# tencentcloud_postgresql_instance_network_access + +Provides a resource to create a postgres postgresql_instance_network_access + +## Example Usage + +```hcl +resource "tencentcloud_postgresql_instance_network_access" "postgresql_instance_network_access" { +} +``` + +## Argument Reference + +The following arguments are supported: + +* `db_instance_id` - (Required, String, ForceNew) Instance ID in the format of postgres-6bwgamo3. +* `is_assign_vip` - (Required, Bool, ForceNew) Whether to manually assign the VIP. Valid values: `true` (manually assign), `false` (automatically assign). +* `subnet_id` - (Required, String, ForceNew) Subnet ID. +* `vpc_id` - (Required, String, ForceNew) Unified VPC ID. +* `vip` - (Optional, String, ForceNew) Target VIP. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `id` - ID of the resource. + + + +## Import + +postgres postgresql_instance_network_access can be imported using the id, e.g. + +``` +terraform import tencentcloud_postgresql_instance_network_access.postgresql_instance_network_access postgresql_instance_network_access_id +``` + diff --git a/website/tencentcloud.erb b/website/tencentcloud.erb index d41ed4c697..2531a65356 100644 --- a/website/tencentcloud.erb +++ b/website/tencentcloud.erb @@ -5959,6 +5959,9 @@
  • tencentcloud_postgresql_instance_ha_config
  • +
  • + tencentcloud_postgresql_instance_network_access +
  • tencentcloud_postgresql_isolate_db_instance_operation