Skip to content

Commit

Permalink
New Resource: alicloud_vpc_ipam_ipam.
Browse files Browse the repository at this point in the history
  • Loading branch information
ChenHanZhang committed Oct 18, 2024
1 parent 2df5ede commit d960647
Show file tree
Hide file tree
Showing 6 changed files with 1,059 additions and 0 deletions.
24 changes: 24 additions & 0 deletions alicloud/connectivity/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -5636,3 +5636,27 @@ func (client *AliyunClient) RpcPost(locationCode string, apiVersion string, apiN
runtime.SetAutoretry(autoRetry)
return conn.DoRequest(tea.String(apiName), nil, tea.String("POST"), tea.String(apiVersion), tea.String("AK"), query, body, runtime)
}
func (client *AliyunClient) NewVpcipamClient() (*rpc.Client, error) {
productCode := "vpcipam"
endpoint := ""
if v, ok := client.config.Endpoints.Load(productCode); !ok || v.(string) == "" {
if err := client.loadEndpoint(productCode); err != nil {
endpoint = fmt.Sprintf("vpcipam.%s.aliyuncs.com", client.config.RegionId)
client.config.Endpoints.Store(productCode, endpoint)
log.Printf("[ERROR] loading %s endpoint got an error: %#v. Using the endpoint %s instead.", productCode, err, endpoint)
}
}
if v, ok := client.config.Endpoints.Load(productCode); ok && v.(string) != "" {
endpoint = v.(string)
}
if endpoint == "" {
return nil, fmt.Errorf("[ERROR] missing the product %s endpoint.", productCode)
}
sdkConfig := client.teaSdkConfig
sdkConfig.SetEndpoint(endpoint)
conn, err := rpc.NewClient(&sdkConfig)
if err != nil {
return nil, fmt.Errorf("unable to initialize the %s client: %#v", productCode, err)
}
return conn, nil
}
1 change: 1 addition & 0 deletions alicloud/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -870,6 +870,7 @@ func Provider() terraform.ResourceProvider {
"alicloud_cms_site_monitors": dataSourceAliCloudCloudMonitorServiceSiteMonitors(),
},
ResourcesMap: map[string]*schema.Resource{
"alicloud_vpc_ipam_ipam": resourceAliCloudVpcIpamIpam(),
"alicloud_sls_collection_policy": resourceAliCloudSlsCollectionPolicy(),
"alicloud_gpdb_db_instance_ip_array": resourceAliCloudGpdbDBInstanceIPArray(),
"alicloud_quotas_template_service": resourceAliCloudQuotasTemplateService(),
Expand Down
Loading

0 comments on commit d960647

Please sign in to comment.