Skip to content

Commit

Permalink
WIP:feat(VPC): Synchronized VPC resources and data sources.
Browse files Browse the repository at this point in the history
  • Loading branch information
Zippo-Wang committed Jan 12, 2024
1 parent ba09928 commit 191ef0e
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 28 deletions.
6 changes: 3 additions & 3 deletions docs/data-sources/vpc_peering_connection_v2.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ The given filters must match exactly one VPC peering connection whose data will
* `peer_tenant_id` (Optional, String) - The Tenant ID of the accepter/peer VPC
of the specific VPC Peering Connection to retrieve.

## Attributes Reference
## Attribute Reference

* `description` - The description of the VPC Peering Connection.
All the arguments above can also be exported attributes.

All of the argument attributes are exported as result attributes.
* `description` - The description of the VPC Peering Connection.
9 changes: 4 additions & 5 deletions docs/data-sources/vpc_subnet_v1.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,11 @@ subnet whose data will be exported as attributes.

* `description` - The description of the subnet.

## **Attributes Reference**
## Attribute Reference

All of the argument attributes are also exported as
result attributes. This data source will complete the data by populating
any fields that are not included in the configuration with the data for
the selected subnet.
All the argument attributes are also exported as result attributes.
This data source will complete the data by populating any fields that are not included in the configuration with the
data for the selected subnet.

* `dns_list` - The IP address list of DNS servers on the subnet.

Expand Down
22 changes: 19 additions & 3 deletions docs/resources/networking_vip_associate_v2.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,16 +46,32 @@ resource "flexibleengine_networking_vip_associate_v2" "vip_associate_1" {

The following arguments are supported:

* `vip_id` - (Required) The ID of vip to attach the port to.
* `region` - (Optional, String, ForceNew) The region in which to create the vip associate resource. If omitted, the
provider-level region will be used.

* `vip_id` - (Required, String, ForceNew) The ID of vip to attach the port to.
Changing this creates a new vip associate.

* `port_ids` - (Required) An array of one or more IDs of the ports to attach the vip to.
* `port_ids` - (Required, List) An array of one or more IDs of the ports to attach the vip to.
Changing this creates a new vip associate.

## Attributes Reference
## Attribute Reference

In addition to all arguments above, the following attributes are exported:

* `id` - The resource ID.

* `vip_subnet_id` - The ID of the subnet this vip connects to.

* `vip_ip_address` - The IP address in the subnet for this vip.

* `ip_addresses` - The IP addresses of ports to attach the vip to.

## Import

Vip associate can be imported using the `vip_id` and port IDs separated by slashes (no limit on the number of
port IDs), e.g.

```shell
terraform import flexibleengine_networking_vip_associate.vip_associated vip_id/port1_id/port2_id
```
7 changes: 4 additions & 3 deletions docs/resources/vpc_peering_connection_v2.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,11 @@ The following arguments are supported:
* `peer_tenant_id` (Optional, String, ForceNew) - Specified the Tenant Id of the accepter tenant.
Changing this creates a new VPC peering connection.

## Attributes Reference
* `description` - (Optional, String) Specifies the description of the VPC peering connection.

All of the argument attributes are also exported as
result attributes:
## Attribute Reference

All the arguments above can also be exported attributes.

* `id` - The VPC peering connection ID.

Expand Down
29 changes: 15 additions & 14 deletions flexibleengine/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -248,11 +248,9 @@ func Provider() *schema.Provider {
"flexibleengine_kms_key_v1": dataSourceKmsKeyV1(),
"flexibleengine_kms_data_key_v1": dataSourceKmsDataKeyV1(),

"flexibleengine_vpc_v1": dataSourceVirtualPrivateCloudVpcV1(),
"flexibleengine_vpc_subnet_v1": dataSourceVpcSubnetV1(),
"flexibleengine_vpc_subnet_ids_v1": dataSourceVpcSubnetIdsV1(),
"flexibleengine_vpc_peering_connection_v2": dataSourceVpcPeeringConnectionV2(),
"flexibleengine_vpc_eip": dataSourceVpcEipV1(),
"flexibleengine_vpc_v1": dataSourceVirtualPrivateCloudVpcV1(),
"flexibleengine_vpc_subnet_ids_v1": dataSourceVpcSubnetIdsV1(),
"flexibleengine_vpc_eip": dataSourceVpcEipV1(),

"flexibleengine_nat_gateway_v2": dataSourceNatGatewayV2(),

Expand Down Expand Up @@ -373,9 +371,12 @@ func Provider() *schema.Provider {
"flexibleengine_smn_topics": smn.DataSourceTopics(),
"flexibleengine_smn_message_templates": smn.DataSourceSmnMessageTemplates(),
"flexibleengine_sms_source_servers": sms.DataSourceServers(),
"flexibleengine_vpc_route_table": vpc.DataSourceVPCRouteTable(),
"flexibleengine_vpc_subnets": vpc.DataSourceVpcSubnets(),
"flexibleengine_vpcs": vpc.DataSourceVpcs(),

"flexibleengine_vpc_peering_connection_v2": vpc.DataSourceVpcPeeringConnectionV2(),
"flexibleengine_vpc_route_table": vpc.DataSourceVPCRouteTable(),
"flexibleengine_vpc_subnet_v1": vpc.DataSourceVpcSubnetV1(),
"flexibleengine_vpc_subnets": vpc.DataSourceVpcSubnets(),
"flexibleengine_vpcs": vpc.DataSourceVpcs(),

"flexibleengine_waf_certificate": waf.DataSourceWafCertificateV1(),
"flexibleengine_waf_dedicated_instances": waf.DataSourceWafDedicatedInstancesV1(),
Expand Down Expand Up @@ -480,8 +481,7 @@ func Provider() *schema.Provider {
"flexibleengine_rds_read_replica_v3": resourceRdsReadReplicaInstance(),
"flexibleengine_rds_parametergroup_v3": resourceRdsConfigurationV3(),

"flexibleengine_networking_vip_v2": resourceNetworkingVIPV2(),
"flexibleengine_networking_vip_associate_v2": resourceNetworkingVIPAssociateV2(),
"flexibleengine_networking_vip_v2": resourceNetworkingVIPV2(),

"flexibleengine_drs_replication_v2": resourceReplication(),
"flexibleengine_drs_replicationconsistencygroup_v2": resourceReplicationConsistencyGroup(),
Expand All @@ -492,7 +492,6 @@ func Provider() *schema.Provider {

"flexibleengine_vpc_eip": resourceVpcEIPV1(),
"flexibleengine_vpc_flow_log_v1": resourceVpcFlowLogV1(),
"flexibleengine_vpc_peering_connection_v2": resourceVpcPeeringConnectionV2(),
"flexibleengine_vpc_peering_connection_accepter_v2": resourceVpcPeeringConnectionAccepterV2(),

"flexibleengine_sfs_file_system_v2": resourceSFSFileSystemV2(),
Expand Down Expand Up @@ -658,9 +657,11 @@ func Provider() *schema.Provider {

"flexibleengine_tms_tags": tms.ResourceTmsTag(),

"flexibleengine_vpc_eip_associate": eip.ResourceEIPAssociate(),
"flexibleengine_vpc_route_table": vpc.ResourceVPCRouteTable(),
"flexibleengine_vpc_route": vpc.ResourceVPCRouteTableRoute(),
"flexibleengine_vpc_eip_associate": eip.ResourceEIPAssociate(),
"flexibleengine_networking_vip_associate_v2": vpc.ResourceNetworkingVIPAssociateV2(),
"flexibleengine_vpc_peering_connection_v2": vpc.ResourceVpcPeeringConnectionV2(),
"flexibleengine_vpc_route_table": vpc.ResourceVPCRouteTable(),
"flexibleengine_vpc_route": vpc.ResourceVPCRouteTableRoute(),

"flexibleengine_waf_dedicated_instance": ResourceWafDedicatedInstance(),
"flexibleengine_waf_dedicated_policy": ResourceWafDedicatedPolicyV1(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ resource "flexibleengine_vpc_peering_connection_v2" "peering_1" {
name = "flexibleengine_peering"
vpc_id = flexibleengine_vpc_v1.vpc_1.id
peer_vpc_id = flexibleengine_vpc_v1.vpc_2.id
description = "tf test1"
}
`
const testAccFlexibleEngineVpcPeeringConnectionV2_update = `
Expand All @@ -126,5 +127,6 @@ resource "flexibleengine_vpc_peering_connection_v2" "peering_1" {
name = "flexibleengine_peering_1"
vpc_id = flexibleengine_vpc_v1.vpc_1.id
peer_vpc_id = flexibleengine_vpc_v1.vpc_2.id
description = "tf update"
}
`

0 comments on commit 191ef0e

Please sign in to comment.