alicloud.amqp.StaticAccount
Explore with Pulumi AI
Provides a Amqp Static Account resource.
For information about Amqp Static Account and how to use it, see What is Static Account.
NOTE: Available since v1.195.0.
Example Usage
Basic Usage
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const config = new pulumi.Config();
const accessKey = config.get("accessKey") || "access_key";
const secretKey = config.get("secretKey") || "secret_key";
const _default = new alicloud.amqp.Instance("default", {
instanceType: "enterprise",
maxTps: "3000",
queueCapacity: "200",
storageSize: "700",
supportEip: false,
maxEipTps: "128",
paymentType: "Subscription",
period: 1,
});
const defaultStaticAccount = new alicloud.amqp.StaticAccount("default", {
instanceId: _default.id,
accessKey: accessKey,
secretKey: secretKey,
});
import pulumi
import pulumi_alicloud as alicloud
config = pulumi.Config()
access_key = config.get("accessKey")
if access_key is None:
access_key = "access_key"
secret_key = config.get("secretKey")
if secret_key is None:
secret_key = "secret_key"
default = alicloud.amqp.Instance("default",
instance_type="enterprise",
max_tps="3000",
queue_capacity="200",
storage_size="700",
support_eip=False,
max_eip_tps="128",
payment_type="Subscription",
period=1)
default_static_account = alicloud.amqp.StaticAccount("default",
instance_id=default.id,
access_key=access_key,
secret_key=secret_key)
package main
import (
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/amqp"
"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, "")
accessKey := "access_key"
if param := cfg.Get("accessKey"); param != "" {
accessKey = param
}
secretKey := "secret_key"
if param := cfg.Get("secretKey"); param != "" {
secretKey = param
}
_, err := amqp.NewInstance(ctx, "default", &amqp.InstanceArgs{
InstanceType: pulumi.String("enterprise"),
MaxTps: pulumi.String("3000"),
QueueCapacity: pulumi.String("200"),
StorageSize: pulumi.String("700"),
SupportEip: pulumi.Bool(false),
MaxEipTps: pulumi.String("128"),
PaymentType: pulumi.String("Subscription"),
Period: pulumi.Int(1),
})
if err != nil {
return err
}
_, err = amqp.NewStaticAccount(ctx, "default", &amqp.StaticAccountArgs{
InstanceId: _default.ID(),
AccessKey: pulumi.String(accessKey),
SecretKey: pulumi.String(secretKey),
})
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 accessKey = config.Get("accessKey") ?? "access_key";
var secretKey = config.Get("secretKey") ?? "secret_key";
var @default = new AliCloud.Amqp.Instance("default", new()
{
InstanceType = "enterprise",
MaxTps = "3000",
QueueCapacity = "200",
StorageSize = "700",
SupportEip = false,
MaxEipTps = "128",
PaymentType = "Subscription",
Period = 1,
});
var defaultStaticAccount = new AliCloud.Amqp.StaticAccount("default", new()
{
InstanceId = @default.Id,
AccessKey = accessKey,
SecretKey = secretKey,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.amqp.Instance;
import com.pulumi.alicloud.amqp.InstanceArgs;
import com.pulumi.alicloud.amqp.StaticAccount;
import com.pulumi.alicloud.amqp.StaticAccountArgs;
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 accessKey = config.get("accessKey").orElse("access_key");
final var secretKey = config.get("secretKey").orElse("secret_key");
var default_ = new Instance("default", InstanceArgs.builder()
.instanceType("enterprise")
.maxTps(3000)
.queueCapacity(200)
.storageSize(700)
.supportEip(false)
.maxEipTps(128)
.paymentType("Subscription")
.period(1)
.build());
var defaultStaticAccount = new StaticAccount("defaultStaticAccount", StaticAccountArgs.builder()
.instanceId(default_.id())
.accessKey(accessKey)
.secretKey(secretKey)
.build());
}
}
configuration:
accessKey:
type: string
default: access_key
secretKey:
type: string
default: secret_key
resources:
default:
type: alicloud:amqp:Instance
properties:
instanceType: enterprise
maxTps: 3000
queueCapacity: 200
storageSize: 700
supportEip: false
maxEipTps: 128
paymentType: Subscription
period: 1
defaultStaticAccount:
type: alicloud:amqp:StaticAccount
name: default
properties:
instanceId: ${default.id}
accessKey: ${accessKey}
secretKey: ${secretKey}
Create StaticAccount Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new StaticAccount(name: string, args: StaticAccountArgs, opts?: CustomResourceOptions);
@overload
def StaticAccount(resource_name: str,
args: StaticAccountArgs,
opts: Optional[ResourceOptions] = None)
@overload
def StaticAccount(resource_name: str,
opts: Optional[ResourceOptions] = None,
access_key: Optional[str] = None,
instance_id: Optional[str] = None,
secret_key: Optional[str] = None)
func NewStaticAccount(ctx *Context, name string, args StaticAccountArgs, opts ...ResourceOption) (*StaticAccount, error)
public StaticAccount(string name, StaticAccountArgs args, CustomResourceOptions? opts = null)
public StaticAccount(String name, StaticAccountArgs args)
public StaticAccount(String name, StaticAccountArgs args, CustomResourceOptions options)
type: alicloud:amqp:StaticAccount
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 StaticAccountArgs
- 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 StaticAccountArgs
- 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 StaticAccountArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args StaticAccountArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args StaticAccountArgs
- 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 staticAccountResource = new AliCloud.Amqp.StaticAccount("staticAccountResource", new()
{
AccessKey = "string",
InstanceId = "string",
SecretKey = "string",
});
example, err := amqp.NewStaticAccount(ctx, "staticAccountResource", &amqp.StaticAccountArgs{
AccessKey: pulumi.String("string"),
InstanceId: pulumi.String("string"),
SecretKey: pulumi.String("string"),
})
var staticAccountResource = new StaticAccount("staticAccountResource", StaticAccountArgs.builder()
.accessKey("string")
.instanceId("string")
.secretKey("string")
.build());
static_account_resource = alicloud.amqp.StaticAccount("staticAccountResource",
access_key="string",
instance_id="string",
secret_key="string")
const staticAccountResource = new alicloud.amqp.StaticAccount("staticAccountResource", {
accessKey: "string",
instanceId: "string",
secretKey: "string",
});
type: alicloud:amqp:StaticAccount
properties:
accessKey: string
instanceId: string
secretKey: string
StaticAccount Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
The StaticAccount resource accepts the following input properties:
- Access
Key string - Access key.
- Instance
Id string - Amqp instance ID.
- Secret
Key string - Secret key.
- Access
Key string - Access key.
- Instance
Id string - Amqp instance ID.
- Secret
Key string - Secret key.
- access
Key String - Access key.
- instance
Id String - Amqp instance ID.
- secret
Key String - Secret key.
- access
Key string - Access key.
- instance
Id string - Amqp instance ID.
- secret
Key string - Secret key.
- access_
key str - Access key.
- instance_
id str - Amqp instance ID.
- secret_
key str - Secret key.
- access
Key String - Access key.
- instance
Id String - Amqp instance ID.
- secret
Key String - Secret key.
Outputs
All input properties are implicitly available as output properties. Additionally, the StaticAccount resource produces the following output properties:
- Create
Time int - Create time stamp. Unix timestamp, to millisecond level.
- Id string
- The provider-assigned unique ID for this managed resource.
- Master
Uid string - The ID of the user's primary account.
- Password string
- Static password.
- User
Name string - Static user name.
- Create
Time int - Create time stamp. Unix timestamp, to millisecond level.
- Id string
- The provider-assigned unique ID for this managed resource.
- Master
Uid string - The ID of the user's primary account.
- Password string
- Static password.
- User
Name string - Static user name.
- create
Time Integer - Create time stamp. Unix timestamp, to millisecond level.
- id String
- The provider-assigned unique ID for this managed resource.
- master
Uid String - The ID of the user's primary account.
- password String
- Static password.
- user
Name String - Static user name.
- create
Time number - Create time stamp. Unix timestamp, to millisecond level.
- id string
- The provider-assigned unique ID for this managed resource.
- master
Uid string - The ID of the user's primary account.
- password string
- Static password.
- user
Name string - Static user name.
- create_
time int - Create time stamp. Unix timestamp, to millisecond level.
- id str
- The provider-assigned unique ID for this managed resource.
- master_
uid str - The ID of the user's primary account.
- password str
- Static password.
- user_
name str - Static user name.
- create
Time Number - Create time stamp. Unix timestamp, to millisecond level.
- id String
- The provider-assigned unique ID for this managed resource.
- master
Uid String - The ID of the user's primary account.
- password String
- Static password.
- user
Name String - Static user name.
Look up Existing StaticAccount Resource
Get an existing StaticAccount 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?: StaticAccountState, opts?: CustomResourceOptions): StaticAccount
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
access_key: Optional[str] = None,
create_time: Optional[int] = None,
instance_id: Optional[str] = None,
master_uid: Optional[str] = None,
password: Optional[str] = None,
secret_key: Optional[str] = None,
user_name: Optional[str] = None) -> StaticAccount
func GetStaticAccount(ctx *Context, name string, id IDInput, state *StaticAccountState, opts ...ResourceOption) (*StaticAccount, error)
public static StaticAccount Get(string name, Input<string> id, StaticAccountState? state, CustomResourceOptions? opts = null)
public static StaticAccount get(String name, Output<String> id, StaticAccountState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- 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.
- Access
Key string - Access key.
- Create
Time int - Create time stamp. Unix timestamp, to millisecond level.
- Instance
Id string - Amqp instance ID.
- Master
Uid string - The ID of the user's primary account.
- Password string
- Static password.
- Secret
Key string - Secret key.
- User
Name string - Static user name.
- Access
Key string - Access key.
- Create
Time int - Create time stamp. Unix timestamp, to millisecond level.
- Instance
Id string - Amqp instance ID.
- Master
Uid string - The ID of the user's primary account.
- Password string
- Static password.
- Secret
Key string - Secret key.
- User
Name string - Static user name.
- access
Key String - Access key.
- create
Time Integer - Create time stamp. Unix timestamp, to millisecond level.
- instance
Id String - Amqp instance ID.
- master
Uid String - The ID of the user's primary account.
- password String
- Static password.
- secret
Key String - Secret key.
- user
Name String - Static user name.
- access
Key string - Access key.
- create
Time number - Create time stamp. Unix timestamp, to millisecond level.
- instance
Id string - Amqp instance ID.
- master
Uid string - The ID of the user's primary account.
- password string
- Static password.
- secret
Key string - Secret key.
- user
Name string - Static user name.
- access_
key str - Access key.
- create_
time int - Create time stamp. Unix timestamp, to millisecond level.
- instance_
id str - Amqp instance ID.
- master_
uid str - The ID of the user's primary account.
- password str
- Static password.
- secret_
key str - Secret key.
- user_
name str - Static user name.
- access
Key String - Access key.
- create
Time Number - Create time stamp. Unix timestamp, to millisecond level.
- instance
Id String - Amqp instance ID.
- master
Uid String - The ID of the user's primary account.
- password String
- Static password.
- secret
Key String - Secret key.
- user
Name String - Static user name.
Import
Amqp Static Account can be imported using the id, e.g.
$ pulumi import alicloud:amqp/staticAccount:StaticAccount example <instance_id>:<access_key>
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.