1. Packages
  2. Alibaba Cloud Provider
  3. API Docs
  4. amqp
  5. StaticAccount
Alibaba Cloud v3.66.0 published on Friday, Nov 15, 2024 by Pulumi

alicloud.amqp.StaticAccount

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.66.0 published on Friday, Nov 15, 2024 by Pulumi

    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

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The StaticAccount resource accepts the following input properties:

    AccessKey string
    Access key.
    InstanceId string
    Amqp instance ID.
    SecretKey string
    Secret key.
    AccessKey string
    Access key.
    InstanceId string
    Amqp instance ID.
    SecretKey string
    Secret key.
    accessKey String
    Access key.
    instanceId String
    Amqp instance ID.
    secretKey String
    Secret key.
    accessKey string
    Access key.
    instanceId string
    Amqp instance ID.
    secretKey string
    Secret key.
    access_key str
    Access key.
    instance_id str
    Amqp instance ID.
    secret_key str
    Secret key.
    accessKey String
    Access key.
    instanceId String
    Amqp instance ID.
    secretKey String
    Secret key.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the StaticAccount resource produces the following output properties:

    CreateTime int
    The timestamp that indicates when the pair of static username and password was created.
    Id string
    The provider-assigned unique ID for this managed resource.
    MasterUid string
    The ID of the user's primary account.
    Password string
    The static password.
    UserName string
    The static username.
    CreateTime int
    The timestamp that indicates when the pair of static username and password was created.
    Id string
    The provider-assigned unique ID for this managed resource.
    MasterUid string
    The ID of the user's primary account.
    Password string
    The static password.
    UserName string
    The static username.
    createTime Integer
    The timestamp that indicates when the pair of static username and password was created.
    id String
    The provider-assigned unique ID for this managed resource.
    masterUid String
    The ID of the user's primary account.
    password String
    The static password.
    userName String
    The static username.
    createTime number
    The timestamp that indicates when the pair of static username and password was created.
    id string
    The provider-assigned unique ID for this managed resource.
    masterUid string
    The ID of the user's primary account.
    password string
    The static password.
    userName string
    The static username.
    create_time int
    The timestamp that indicates when the pair of static username and password was created.
    id str
    The provider-assigned unique ID for this managed resource.
    master_uid str
    The ID of the user's primary account.
    password str
    The static password.
    user_name str
    The static username.
    createTime Number
    The timestamp that indicates when the pair of static username and password was created.
    id String
    The provider-assigned unique ID for this managed resource.
    masterUid String
    The ID of the user's primary account.
    password String
    The static password.
    userName String
    The static username.

    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.
    The following state arguments are supported:
    AccessKey string
    Access key.
    CreateTime int
    The timestamp that indicates when the pair of static username and password was created.
    InstanceId string
    Amqp instance ID.
    MasterUid string
    The ID of the user's primary account.
    Password string
    The static password.
    SecretKey string
    Secret key.
    UserName string
    The static username.
    AccessKey string
    Access key.
    CreateTime int
    The timestamp that indicates when the pair of static username and password was created.
    InstanceId string
    Amqp instance ID.
    MasterUid string
    The ID of the user's primary account.
    Password string
    The static password.
    SecretKey string
    Secret key.
    UserName string
    The static username.
    accessKey String
    Access key.
    createTime Integer
    The timestamp that indicates when the pair of static username and password was created.
    instanceId String
    Amqp instance ID.
    masterUid String
    The ID of the user's primary account.
    password String
    The static password.
    secretKey String
    Secret key.
    userName String
    The static username.
    accessKey string
    Access key.
    createTime number
    The timestamp that indicates when the pair of static username and password was created.
    instanceId string
    Amqp instance ID.
    masterUid string
    The ID of the user's primary account.
    password string
    The static password.
    secretKey string
    Secret key.
    userName string
    The static username.
    access_key str
    Access key.
    create_time int
    The timestamp that indicates when the pair of static username and password was created.
    instance_id str
    Amqp instance ID.
    master_uid str
    The ID of the user's primary account.
    password str
    The static password.
    secret_key str
    Secret key.
    user_name str
    The static username.
    accessKey String
    Access key.
    createTime Number
    The timestamp that indicates when the pair of static username and password was created.
    instanceId String
    Amqp instance ID.
    masterUid String
    The ID of the user's primary account.
    password String
    The static password.
    secretKey String
    Secret key.
    userName String
    The static username.

    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.
    alicloud logo
    Alibaba Cloud v3.66.0 published on Friday, Nov 15, 2024 by Pulumi