1. Packages
  2. Logzio Provider
  3. API Docs
  4. MetricsAccount
logzio 1.17.1 published on Monday, Apr 14, 2025 by logzio

logzio.MetricsAccount

Explore with Pulumi AI

logzio logo
logzio 1.17.1 published on Monday, Apr 14, 2025 by logzio

    # Metrics accounts Provider

    Provides a Logz.io Metrics account management resource. This can be used to create and manage Logz.io metric accounts.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as logzio from "@pulumi/logzio";
    
    const config = new pulumi.Config();
    const apiToken = config.require("apiToken");
    const myMetricsAccount = new logzio.MetricsAccount("myMetricsAccount", {
        email: "user@logz.io",
        accountName: "test",
        planUts: 100,
        authorizedAccounts: [12345],
    });
    
    import pulumi
    import pulumi_logzio as logzio
    
    config = pulumi.Config()
    api_token = config.require("apiToken")
    my_metrics_account = logzio.MetricsAccount("myMetricsAccount",
        email="user@logz.io",
        account_name="test",
        plan_uts=100,
        authorized_accounts=[12345])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/logzio/logzio"
    	"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, "")
    		apiToken := cfg.Require("apiToken")
    		_, err := logzio.NewMetricsAccount(ctx, "myMetricsAccount", &logzio.MetricsAccountArgs{
    			Email:       pulumi.String("user@logz.io"),
    			AccountName: pulumi.String("test"),
    			PlanUts:     pulumi.Float64(100),
    			AuthorizedAccounts: pulumi.Float64Array{
    				pulumi.Float64(12345),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Logzio = Pulumi.Logzio;
    
    return await Deployment.RunAsync(() => 
    {
        var config = new Config();
        var apiToken = config.Require("apiToken");
        var myMetricsAccount = new Logzio.MetricsAccount("myMetricsAccount", new()
        {
            Email = "user@logz.io",
            AccountName = "test",
            PlanUts = 100,
            AuthorizedAccounts = new[]
            {
                12345,
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.logzio.MetricsAccount;
    import com.pulumi.logzio.MetricsAccountArgs;
    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 apiToken = config.get("apiToken");
            var myMetricsAccount = new MetricsAccount("myMetricsAccount", MetricsAccountArgs.builder()
                .email("user@logz.io")
                .accountName("test")
                .planUts(100)
                .authorizedAccounts(12345)
                .build());
    
        }
    }
    
    configuration:
      apiToken:
        type: string
    resources:
      myMetricsAccount:
        type: logzio:MetricsAccount
        properties:
          email: user@logz.io
          accountName: test
          planUts: 100
          authorizedAccounts:
            - 12345
    

    Attribute Reference

    • account_id - ID of the metrics account.
    • account_token - Log shipping token for the metrics account. Learn more

    Endpoints used

    Create MetricsAccount Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new MetricsAccount(name: string, args: MetricsAccountArgs, opts?: CustomResourceOptions);
    @overload
    def MetricsAccount(resource_name: str,
                       args: MetricsAccountArgs,
                       opts: Optional[ResourceOptions] = None)
    
    @overload
    def MetricsAccount(resource_name: str,
                       opts: Optional[ResourceOptions] = None,
                       email: Optional[str] = None,
                       account_name: Optional[str] = None,
                       authorized_accounts: Optional[Sequence[float]] = None,
                       metrics_account_id: Optional[str] = None,
                       plan_uts: Optional[float] = None)
    func NewMetricsAccount(ctx *Context, name string, args MetricsAccountArgs, opts ...ResourceOption) (*MetricsAccount, error)
    public MetricsAccount(string name, MetricsAccountArgs args, CustomResourceOptions? opts = null)
    public MetricsAccount(String name, MetricsAccountArgs args)
    public MetricsAccount(String name, MetricsAccountArgs args, CustomResourceOptions options)
    
    type: logzio:MetricsAccount
    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 MetricsAccountArgs
    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 MetricsAccountArgs
    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 MetricsAccountArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args MetricsAccountArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args MetricsAccountArgs
    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 metricsAccountResource = new Logzio.MetricsAccount("metricsAccountResource", new()
    {
        Email = "string",
        AccountName = "string",
        AuthorizedAccounts = new[]
        {
            0,
        },
        MetricsAccountId = "string",
        PlanUts = 0,
    });
    
    example, err := logzio.NewMetricsAccount(ctx, "metricsAccountResource", &logzio.MetricsAccountArgs{
    	Email:       pulumi.String("string"),
    	AccountName: pulumi.String("string"),
    	AuthorizedAccounts: pulumi.Float64Array{
    		pulumi.Float64(0),
    	},
    	MetricsAccountId: pulumi.String("string"),
    	PlanUts:          pulumi.Float64(0),
    })
    
    var metricsAccountResource = new MetricsAccount("metricsAccountResource", MetricsAccountArgs.builder()
        .email("string")
        .accountName("string")
        .authorizedAccounts(0)
        .metricsAccountId("string")
        .planUts(0)
        .build());
    
    metrics_account_resource = logzio.MetricsAccount("metricsAccountResource",
        email="string",
        account_name="string",
        authorized_accounts=[0],
        metrics_account_id="string",
        plan_uts=0)
    
    const metricsAccountResource = new logzio.MetricsAccount("metricsAccountResource", {
        email: "string",
        accountName: "string",
        authorizedAccounts: [0],
        metricsAccountId: "string",
        planUts: 0,
    });
    
    type: logzio:MetricsAccount
    properties:
        accountName: string
        authorizedAccounts:
            - 0
        email: string
        metricsAccountId: string
        planUts: 0
    

    MetricsAccount 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 MetricsAccount resource accepts the following input properties:

    Email string
    AccountName string
    AuthorizedAccounts List<double>
    MetricsAccountId string
    PlanUts double
    Email string
    AccountName string
    AuthorizedAccounts []float64
    MetricsAccountId string
    PlanUts float64
    email String
    accountName String
    authorizedAccounts List<Double>
    metricsAccountId String
    planUts Double
    email String
    accountName String
    authorizedAccounts List<Number>
    metricsAccountId String
    planUts Number

    Outputs

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

    AccountId double
    AccountToken string
    Id string
    The provider-assigned unique ID for this managed resource.
    AccountId float64
    AccountToken string
    Id string
    The provider-assigned unique ID for this managed resource.
    accountId Double
    accountToken String
    id String
    The provider-assigned unique ID for this managed resource.
    accountId number
    accountToken string
    id string
    The provider-assigned unique ID for this managed resource.
    account_id float
    account_token str
    id str
    The provider-assigned unique ID for this managed resource.
    accountId Number
    accountToken String
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing MetricsAccount Resource

    Get an existing MetricsAccount 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?: MetricsAccountState, opts?: CustomResourceOptions): MetricsAccount
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            account_id: Optional[float] = None,
            account_name: Optional[str] = None,
            account_token: Optional[str] = None,
            authorized_accounts: Optional[Sequence[float]] = None,
            email: Optional[str] = None,
            metrics_account_id: Optional[str] = None,
            plan_uts: Optional[float] = None) -> MetricsAccount
    func GetMetricsAccount(ctx *Context, name string, id IDInput, state *MetricsAccountState, opts ...ResourceOption) (*MetricsAccount, error)
    public static MetricsAccount Get(string name, Input<string> id, MetricsAccountState? state, CustomResourceOptions? opts = null)
    public static MetricsAccount get(String name, Output<String> id, MetricsAccountState state, CustomResourceOptions options)
    resources:  _:    type: logzio:MetricsAccount    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.
    The following state arguments are supported:
    AccountId double
    AccountName string
    AccountToken string
    AuthorizedAccounts List<double>
    Email string
    MetricsAccountId string
    PlanUts double
    AccountId float64
    AccountName string
    AccountToken string
    AuthorizedAccounts []float64
    Email string
    MetricsAccountId string
    PlanUts float64
    accountId Double
    accountName String
    accountToken String
    authorizedAccounts List<Double>
    email String
    metricsAccountId String
    planUts Double
    accountId Number
    accountName String
    accountToken String
    authorizedAccounts List<Number>
    email String
    metricsAccountId String
    planUts Number

    Package Details

    Repository
    logzio logzio/terraform-provider-logzio
    License
    Notes
    This Pulumi package is based on the logzio Terraform Provider.
    logzio logo
    logzio 1.17.1 published on Monday, Apr 14, 2025 by logzio