alicloud.rocketmq.Account
Explore with Pulumi AI
Provides a RocketMQ Account resource.
For information about RocketMQ Account and how to use it, see What is Account.
NOTE: Available since v1.245.0.
Example Usage
Basic Usage
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const config = new pulumi.Config();
const name = config.get("name") || "terraform-example";
const defaultg6ZXs2 = new alicloud.vpc.Network("defaultg6ZXs2", {
description: "111",
cidrBlock: "192.168.0.0/16",
vpcName: "pop-example-vpc",
});
const defaultvMQbCy = new alicloud.vpc.Switch("defaultvMQbCy", {
vpcId: defaultg6ZXs2.id,
zoneId: "cn-hangzhou-j",
cidrBlock: "192.168.0.0/24",
vswitchName: "pop-example-vswitch",
});
const default9hAb83 = new alicloud.rocketmq.RocketMQInstance("default9hAb83", {
productInfo: {
msgProcessSpec: "rmq.p2.4xlarge",
sendReceiveRatio: 0.3,
messageRetentionTime: 70,
},
serviceCode: "rmq",
seriesCode: "professional",
paymentType: "PayAsYouGo",
instanceName: name,
subSeriesCode: "cluster_ha",
remark: "example",
software: {
maintainTime: "02:00-06:00",
},
tags: {
Created: "TF",
For: "example",
},
networkInfo: {
vpcInfo: {
vpcId: defaultg6ZXs2.id,
vswitches: [{
vswitchId: defaultvMQbCy.id,
}],
},
internetInfo: {
internetSpec: "enable",
flowOutType: "payByBandwidth",
flowOutBandwidth: 30,
},
},
aclInfo: {
defaultVpcAuthFree: false,
aclTypes: [
"default",
"apache_acl",
],
},
});
const _default = new alicloud.rocketmq.Account("default", {
accountStatus: "ENABLE",
instanceId: default9hAb83.id,
username: "tfexample",
password: "1741835136",
});
import pulumi
import pulumi_alicloud as alicloud
config = pulumi.Config()
name = config.get("name")
if name is None:
name = "terraform-example"
defaultg6_zxs2 = alicloud.vpc.Network("defaultg6ZXs2",
description="111",
cidr_block="192.168.0.0/16",
vpc_name="pop-example-vpc")
defaultv_m_qb_cy = alicloud.vpc.Switch("defaultvMQbCy",
vpc_id=defaultg6_zxs2.id,
zone_id="cn-hangzhou-j",
cidr_block="192.168.0.0/24",
vswitch_name="pop-example-vswitch")
default9h_ab83 = alicloud.rocketmq.RocketMQInstance("default9hAb83",
product_info={
"msg_process_spec": "rmq.p2.4xlarge",
"send_receive_ratio": 0.3,
"message_retention_time": 70,
},
service_code="rmq",
series_code="professional",
payment_type="PayAsYouGo",
instance_name=name,
sub_series_code="cluster_ha",
remark="example",
software={
"maintain_time": "02:00-06:00",
},
tags={
"Created": "TF",
"For": "example",
},
network_info={
"vpc_info": {
"vpc_id": defaultg6_zxs2.id,
"vswitches": [{
"vswitch_id": defaultv_m_qb_cy.id,
}],
},
"internet_info": {
"internet_spec": "enable",
"flow_out_type": "payByBandwidth",
"flow_out_bandwidth": 30,
},
},
acl_info={
"default_vpc_auth_free": False,
"acl_types": [
"default",
"apache_acl",
],
})
default = alicloud.rocketmq.Account("default",
account_status="ENABLE",
instance_id=default9h_ab83.id,
username="tfexample",
password="1741835136")
package main
import (
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/rocketmq"
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/vpc"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
cfg := config.New(ctx, "")
name := "terraform-example"
if param := cfg.Get("name"); param != "" {
name = param
}
defaultg6ZXs2, err := vpc.NewNetwork(ctx, "defaultg6ZXs2", &vpc.NetworkArgs{
Description: pulumi.String("111"),
CidrBlock: pulumi.String("192.168.0.0/16"),
VpcName: pulumi.String("pop-example-vpc"),
})
if err != nil {
return err
}
defaultvMQbCy, err := vpc.NewSwitch(ctx, "defaultvMQbCy", &vpc.SwitchArgs{
VpcId: defaultg6ZXs2.ID(),
ZoneId: pulumi.String("cn-hangzhou-j"),
CidrBlock: pulumi.String("192.168.0.0/24"),
VswitchName: pulumi.String("pop-example-vswitch"),
})
if err != nil {
return err
}
default9hAb83, err := rocketmq.NewRocketMQInstance(ctx, "default9hAb83", &rocketmq.RocketMQInstanceArgs{
ProductInfo: &rocketmq.RocketMQInstanceProductInfoArgs{
MsgProcessSpec: pulumi.String("rmq.p2.4xlarge"),
SendReceiveRatio: pulumi.Float64(0.3),
MessageRetentionTime: pulumi.Int(70),
},
ServiceCode: pulumi.String("rmq"),
SeriesCode: pulumi.String("professional"),
PaymentType: pulumi.String("PayAsYouGo"),
InstanceName: pulumi.String(name),
SubSeriesCode: pulumi.String("cluster_ha"),
Remark: pulumi.String("example"),
Software: &rocketmq.RocketMQInstanceSoftwareArgs{
MaintainTime: pulumi.String("02:00-06:00"),
},
Tags: pulumi.StringMap{
"Created": pulumi.String("TF"),
"For": pulumi.String("example"),
},
NetworkInfo: &rocketmq.RocketMQInstanceNetworkInfoArgs{
VpcInfo: &rocketmq.RocketMQInstanceNetworkInfoVpcInfoArgs{
VpcId: defaultg6ZXs2.ID(),
Vswitches: rocketmq.RocketMQInstanceNetworkInfoVpcInfoVswitchArray{
&rocketmq.RocketMQInstanceNetworkInfoVpcInfoVswitchArgs{
VswitchId: defaultvMQbCy.ID(),
},
},
},
InternetInfo: &rocketmq.RocketMQInstanceNetworkInfoInternetInfoArgs{
InternetSpec: pulumi.String("enable"),
FlowOutType: pulumi.String("payByBandwidth"),
FlowOutBandwidth: pulumi.Int(30),
},
},
AclInfo: &rocketmq.RocketMQInstanceAclInfoArgs{
DefaultVpcAuthFree: pulumi.Bool(false),
AclTypes: pulumi.StringArray{
pulumi.String("default"),
pulumi.String("apache_acl"),
},
},
})
if err != nil {
return err
}
_, err = rocketmq.NewAccount(ctx, "default", &rocketmq.AccountArgs{
AccountStatus: pulumi.String("ENABLE"),
InstanceId: default9hAb83.ID(),
Username: pulumi.String("tfexample"),
Password: pulumi.String("1741835136"),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
return await Deployment.RunAsync(() =>
{
var config = new Config();
var name = config.Get("name") ?? "terraform-example";
var defaultg6ZXs2 = new AliCloud.Vpc.Network("defaultg6ZXs2", new()
{
Description = "111",
CidrBlock = "192.168.0.0/16",
VpcName = "pop-example-vpc",
});
var defaultvMQbCy = new AliCloud.Vpc.Switch("defaultvMQbCy", new()
{
VpcId = defaultg6ZXs2.Id,
ZoneId = "cn-hangzhou-j",
CidrBlock = "192.168.0.0/24",
VswitchName = "pop-example-vswitch",
});
var default9hAb83 = new AliCloud.RocketMQ.RocketMQInstance("default9hAb83", new()
{
ProductInfo = new AliCloud.RocketMQ.Inputs.RocketMQInstanceProductInfoArgs
{
MsgProcessSpec = "rmq.p2.4xlarge",
SendReceiveRatio = 0.3,
MessageRetentionTime = 70,
},
ServiceCode = "rmq",
SeriesCode = "professional",
PaymentType = "PayAsYouGo",
InstanceName = name,
SubSeriesCode = "cluster_ha",
Remark = "example",
Software = new AliCloud.RocketMQ.Inputs.RocketMQInstanceSoftwareArgs
{
MaintainTime = "02:00-06:00",
},
Tags =
{
{ "Created", "TF" },
{ "For", "example" },
},
NetworkInfo = new AliCloud.RocketMQ.Inputs.RocketMQInstanceNetworkInfoArgs
{
VpcInfo = new AliCloud.RocketMQ.Inputs.RocketMQInstanceNetworkInfoVpcInfoArgs
{
VpcId = defaultg6ZXs2.Id,
Vswitches = new[]
{
new AliCloud.RocketMQ.Inputs.RocketMQInstanceNetworkInfoVpcInfoVswitchArgs
{
VswitchId = defaultvMQbCy.Id,
},
},
},
InternetInfo = new AliCloud.RocketMQ.Inputs.RocketMQInstanceNetworkInfoInternetInfoArgs
{
InternetSpec = "enable",
FlowOutType = "payByBandwidth",
FlowOutBandwidth = 30,
},
},
AclInfo = new AliCloud.RocketMQ.Inputs.RocketMQInstanceAclInfoArgs
{
DefaultVpcAuthFree = false,
AclTypes = new[]
{
"default",
"apache_acl",
},
},
});
var @default = new AliCloud.RocketMQ.Account("default", new()
{
AccountStatus = "ENABLE",
InstanceId = default9hAb83.Id,
Username = "tfexample",
Password = "1741835136",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.vpc.Network;
import com.pulumi.alicloud.vpc.NetworkArgs;
import com.pulumi.alicloud.vpc.Switch;
import com.pulumi.alicloud.vpc.SwitchArgs;
import com.pulumi.alicloud.rocketmq.RocketMQInstance;
import com.pulumi.alicloud.rocketmq.RocketMQInstanceArgs;
import com.pulumi.alicloud.rocketmq.inputs.RocketMQInstanceProductInfoArgs;
import com.pulumi.alicloud.rocketmq.inputs.RocketMQInstanceSoftwareArgs;
import com.pulumi.alicloud.rocketmq.inputs.RocketMQInstanceNetworkInfoArgs;
import com.pulumi.alicloud.rocketmq.inputs.RocketMQInstanceNetworkInfoVpcInfoArgs;
import com.pulumi.alicloud.rocketmq.inputs.RocketMQInstanceNetworkInfoInternetInfoArgs;
import com.pulumi.alicloud.rocketmq.inputs.RocketMQInstanceAclInfoArgs;
import com.pulumi.alicloud.rocketmq.Account;
import com.pulumi.alicloud.rocketmq.AccountArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
final var config = ctx.config();
final var name = config.get("name").orElse("terraform-example");
var defaultg6ZXs2 = new Network("defaultg6ZXs2", NetworkArgs.builder()
.description("111")
.cidrBlock("192.168.0.0/16")
.vpcName("pop-example-vpc")
.build());
var defaultvMQbCy = new Switch("defaultvMQbCy", SwitchArgs.builder()
.vpcId(defaultg6ZXs2.id())
.zoneId("cn-hangzhou-j")
.cidrBlock("192.168.0.0/24")
.vswitchName("pop-example-vswitch")
.build());
var default9hAb83 = new RocketMQInstance("default9hAb83", RocketMQInstanceArgs.builder()
.productInfo(RocketMQInstanceProductInfoArgs.builder()
.msgProcessSpec("rmq.p2.4xlarge")
.sendReceiveRatio("0.3")
.messageRetentionTime("70")
.build())
.serviceCode("rmq")
.seriesCode("professional")
.paymentType("PayAsYouGo")
.instanceName(name)
.subSeriesCode("cluster_ha")
.remark("example")
.software(RocketMQInstanceSoftwareArgs.builder()
.maintainTime("02:00-06:00")
.build())
.tags(Map.ofEntries(
Map.entry("Created", "TF"),
Map.entry("For", "example")
))
.networkInfo(RocketMQInstanceNetworkInfoArgs.builder()
.vpcInfo(RocketMQInstanceNetworkInfoVpcInfoArgs.builder()
.vpcId(defaultg6ZXs2.id())
.vswitches(RocketMQInstanceNetworkInfoVpcInfoVswitchArgs.builder()
.vswitchId(defaultvMQbCy.id())
.build())
.build())
.internetInfo(RocketMQInstanceNetworkInfoInternetInfoArgs.builder()
.internetSpec("enable")
.flowOutType("payByBandwidth")
.flowOutBandwidth("30")
.build())
.build())
.aclInfo(RocketMQInstanceAclInfoArgs.builder()
.defaultVpcAuthFree(false)
.aclTypes(
"default",
"apache_acl")
.build())
.build());
var default_ = new Account("default", AccountArgs.builder()
.accountStatus("ENABLE")
.instanceId(default9hAb83.id())
.username("tfexample")
.password("1741835136")
.build());
}
}
configuration:
name:
type: string
default: terraform-example
resources:
defaultg6ZXs2:
type: alicloud:vpc:Network
properties:
description: '111'
cidrBlock: 192.168.0.0/16
vpcName: pop-example-vpc
defaultvMQbCy:
type: alicloud:vpc:Switch
properties:
vpcId: ${defaultg6ZXs2.id}
zoneId: cn-hangzhou-j
cidrBlock: 192.168.0.0/24
vswitchName: pop-example-vswitch
default9hAb83:
type: alicloud:rocketmq:RocketMQInstance
properties:
productInfo:
msgProcessSpec: rmq.p2.4xlarge
sendReceiveRatio: '0.3'
messageRetentionTime: '70'
serviceCode: rmq
seriesCode: professional
paymentType: PayAsYouGo
instanceName: ${name}
subSeriesCode: cluster_ha
remark: example
software:
maintainTime: 02:00-06:00
tags:
Created: TF
For: example
networkInfo:
vpcInfo:
vpcId: ${defaultg6ZXs2.id}
vswitches:
- vswitchId: ${defaultvMQbCy.id}
internetInfo:
internetSpec: enable
flowOutType: payByBandwidth
flowOutBandwidth: '30'
aclInfo:
defaultVpcAuthFree: false
aclTypes:
- default
- apache_acl
default:
type: alicloud:rocketmq:Account
properties:
accountStatus: ENABLE
instanceId: ${default9hAb83.id}
username: tfexample
password: '1741835136'
Create Account Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Account(name: string, args: AccountArgs, opts?: CustomResourceOptions);
@overload
def Account(resource_name: str,
args: AccountArgs,
opts: Optional[ResourceOptions] = None)
@overload
def Account(resource_name: str,
opts: Optional[ResourceOptions] = None,
instance_id: Optional[str] = None,
password: Optional[str] = None,
username: Optional[str] = None,
account_status: Optional[str] = None)
func NewAccount(ctx *Context, name string, args AccountArgs, opts ...ResourceOption) (*Account, error)
public Account(string name, AccountArgs args, CustomResourceOptions? opts = null)
public Account(String name, AccountArgs args)
public Account(String name, AccountArgs args, CustomResourceOptions options)
type: alicloud:rocketmq:Account
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args AccountArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args AccountArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args AccountArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args AccountArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args AccountArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var exampleaccountResourceResourceFromRocketmqaccount = new AliCloud.RocketMQ.Account("exampleaccountResourceResourceFromRocketmqaccount", new()
{
InstanceId = "string",
Password = "string",
Username = "string",
AccountStatus = "string",
});
example, err := rocketmq.NewAccount(ctx, "exampleaccountResourceResourceFromRocketmqaccount", &rocketmq.AccountArgs{
InstanceId: pulumi.String("string"),
Password: pulumi.String("string"),
Username: pulumi.String("string"),
AccountStatus: pulumi.String("string"),
})
var exampleaccountResourceResourceFromRocketmqaccount = new com.pulumi.alicloud.rocketmq.Account("exampleaccountResourceResourceFromRocketmqaccount", com.pulumi.alicloud.rocketmq.AccountArgs.builder()
.instanceId("string")
.password("string")
.username("string")
.accountStatus("string")
.build());
exampleaccount_resource_resource_from_rocketmqaccount = alicloud.rocketmq.Account("exampleaccountResourceResourceFromRocketmqaccount",
instance_id="string",
password="string",
username="string",
account_status="string")
const exampleaccountResourceResourceFromRocketmqaccount = new alicloud.rocketmq.Account("exampleaccountResourceResourceFromRocketmqaccount", {
instanceId: "string",
password: "string",
username: "string",
accountStatus: "string",
});
type: alicloud:rocketmq:Account
properties:
accountStatus: string
instanceId: string
password: string
username: string
Account Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The Account resource accepts the following input properties:
- Instance
Id string - The instance ID.
- Password string
- The password of the account.
- Username string
- The username of the account.
- Account
Status string - The status of the account. Valid values:
DISABLE
,ENABLE
.
- Instance
Id string - The instance ID.
- Password string
- The password of the account.
- Username string
- The username of the account.
- Account
Status string - The status of the account. Valid values:
DISABLE
,ENABLE
.
- instance
Id String - The instance ID.
- password String
- The password of the account.
- username String
- The username of the account.
- account
Status String - The status of the account. Valid values:
DISABLE
,ENABLE
.
- instance
Id string - The instance ID.
- password string
- The password of the account.
- username string
- The username of the account.
- account
Status string - The status of the account. Valid values:
DISABLE
,ENABLE
.
- instance_
id str - The instance ID.
- password str
- The password of the account.
- username str
- The username of the account.
- account_
status str - The status of the account. Valid values:
DISABLE
,ENABLE
.
- instance
Id String - The instance ID.
- password String
- The password of the account.
- username String
- The username of the account.
- account
Status String - The status of the account. Valid values:
DISABLE
,ENABLE
.
Outputs
All input properties are implicitly available as output properties. Additionally, the Account resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- Id string
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
- id string
- The provider-assigned unique ID for this managed resource.
- id str
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
Look up Existing Account Resource
Get an existing Account resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: AccountState, opts?: CustomResourceOptions): Account
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
account_status: Optional[str] = None,
instance_id: Optional[str] = None,
password: Optional[str] = None,
username: Optional[str] = None) -> Account
func GetAccount(ctx *Context, name string, id IDInput, state *AccountState, opts ...ResourceOption) (*Account, error)
public static Account Get(string name, Input<string> id, AccountState? state, CustomResourceOptions? opts = null)
public static Account get(String name, Output<String> id, AccountState state, CustomResourceOptions options)
resources: _: type: alicloud:rocketmq:Account get: id: ${id}
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Account
Status string - The status of the account. Valid values:
DISABLE
,ENABLE
. - Instance
Id string - The instance ID.
- Password string
- The password of the account.
- Username string
- The username of the account.
- Account
Status string - The status of the account. Valid values:
DISABLE
,ENABLE
. - Instance
Id string - The instance ID.
- Password string
- The password of the account.
- Username string
- The username of the account.
- account
Status String - The status of the account. Valid values:
DISABLE
,ENABLE
. - instance
Id String - The instance ID.
- password String
- The password of the account.
- username String
- The username of the account.
- account
Status string - The status of the account. Valid values:
DISABLE
,ENABLE
. - instance
Id string - The instance ID.
- password string
- The password of the account.
- username string
- The username of the account.
- account_
status str - The status of the account. Valid values:
DISABLE
,ENABLE
. - instance_
id str - The instance ID.
- password str
- The password of the account.
- username str
- The username of the account.
- account
Status String - The status of the account. Valid values:
DISABLE
,ENABLE
. - instance
Id String - The instance ID.
- password String
- The password of the account.
- username String
- The username of the account.
Import
RocketMQ Account can be imported using the id, e.g.
$ pulumi import alicloud:rocketmq/account:Account example <instance_id>:<username>
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- Alibaba Cloud pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
alicloud
Terraform Provider.