Skip to content

Commit

Permalink
resource/alicloud_amqp_instance: add new attribute auto_renew, create…
Browse files Browse the repository at this point in the history
…_time, max_connections, period_cycle, serverless_charge_type.
  • Loading branch information
ChenHanZhang committed Mar 15, 2024
1 parent ee93477 commit 9fc32d4
Show file tree
Hide file tree
Showing 6 changed files with 853 additions and 436 deletions.
24 changes: 24 additions & 0 deletions alicloud/connectivity/client.go
Expand Up @@ -5402,3 +5402,27 @@ func (client *AliyunClient) NewDfsClient() (*rpc.Client, error) {
}
return conn, nil
}
func (client *AliyunClient) NewAmqpClient() (*rpc.Client, error) {
productCode := "amqp-open"
endpoint := ""
if v, ok := client.config.Endpoints.Load(productCode); !ok || v.(string) == "" {
if err := client.loadEndpoint(productCode); err != nil {
endpoint = fmt.Sprintf("amqp-open.%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
}
2 changes: 1 addition & 1 deletion alicloud/provider.go
Expand Up @@ -1310,7 +1310,7 @@ func Provider() terraform.ResourceProvider {
"alicloud_amqp_exchange": resourceAlicloudAmqpExchange(),
"alicloud_cassandra_backup_plan": resourceAlicloudCassandraBackupPlan(),
"alicloud_cen_transit_router_peer_attachment": resourceAlicloudCenTransitRouterPeerAttachment(),
"alicloud_amqp_instance": resourceAlicloudAmqpInstance(),
"alicloud_amqp_instance": resourceAliCloudAmqpInstance(),
"alicloud_hbr_vault": resourceAliCloudHbrVault(),
"alicloud_ssl_certificates_service_certificate": resourceAliCloudSslCertificatesServiceCertificate(),
"alicloud_arms_alert_contact": resourceAlicloudArmsAlertContact(),
Expand Down

0 comments on commit 9fc32d4

Please sign in to comment.